import request from "@/utils/request";
import { AxiosPromise } from "axios";

/**
* 百盛订单明细表数据
*
* @param queryParams
*/
export function getBsOmsOrderDetailPage(queryParams) {
    return request({
        url: '/api/v1/bsOmsOrderDetail/page',
        method: 'get',
        params: queryParams
    });
}


/**
* 获取百盛订单明细表表单数据
*
* @param queryParams
*/
export function getBsOmsOrderDetailForm(id: number){
    return request({
        url: '/api/v1/bsOmsOrderDetail/' + id + '/form',
        method: 'get'
    });
}

/**
* 保存百盛订单明细表
*
* @param data
*/
export function saveBsOmsOrderDetail(data) {
    return request({
        url: "/api/v1/bsOmsOrderDetail",
        method: "post",
        data: data,
    });
}

/**
* 删除百盛订单明细表
*
* @param ids
*/
export function deleteBsOmsOrderDetail(ids: string) {
    return request({
    url: '/api/v1/bsOmsOrderDetail/' + ids,
    method: 'delete'
    });
}

/**
* 导入百盛订单明细表
*
* @param file
*/
export function importBsOmsOrderDetail(file: any) {
    const formData = new FormData();
    formData.append('file', file);
    return request({
        url: '/api/v1/bsOmsOrderDetail/bsOmsOrderDetailImport',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

/**
* 导出百盛订单明细表
*
* @param ids
* @returns
*/
export function exportBsOmsOrderDetail(ids: any) {
    return request({
        url: '/api/v1/bsOmsOrderDetail/_export?ids='+ids,
        method: 'get',
        responseType: 'arraybuffer'
    });
}